package com.sentiment.database.bean;

import java.util.Date;
import java.util.List;
import java.util.Map;

import org.bson.BsonDocument;
import org.bson.BsonDocumentWrapper;
import org.bson.Document;
import org.bson.codecs.configuration.CodecRegistry;
import org.bson.types.ObjectId;

@SuppressWarnings("serial")
public class HotspotReport extends Document {

	// private ObjectId _id;
	// //热点报告的开始时间
	// private Date beginDate;
	// //热点报告的结束时间
	// private Date endDate;
	// //热点报告的标题
	// private String title;
	// //热点报告的正文
	// private List<String> text;
	// //热点报告的微博采样数据
	// private List<String> weiboOpinion_id;
	// //热点报告的论坛采样数据
	// private List<String> forumOpinion_id;
	// //热点报告的评论变化
	// private Map<Date,Integer> commentRatio;
	// //热点报告的舆情导向变化
	// private Map<Date, Double> sentimentRatio;
	// //热点报告的转载数变化
	// private Map<Date, Integer> reprintRatio;
	public  HotspotReport(Integer status){
		append("status", status);
	}
	public HotspotReport(ObjectId _id) {
		append("_id", _id);
	}

	public HotspotReport() {
		// TODO Auto-generated constructor stub
	}

	public HotspotReport(String beginDate, String endDate, String title, List<String> text, List<String> weiboOpinion_id,
			List<String> forumOpinion_id) {
		append("beginDate", beginDate);
		append("endDate", endDate);
		append("title", title);
		append("text", text);
		append("weiboOpinion_id", weiboOpinion_id);
		append("forumOpinion_id", forumOpinion_id);
	}

	public HotspotReport(ObjectId _id, String beginDate, String endDate, String title, List<String> text,
			List<String> weiboOpinion_id, List<String> forumOpinion_id, Map<Date, Integer> commentRatio,
			Map<Date, Double> sentimentRatio, Map<Date, Integer> reprintRatio, Integer watchCount) {
		append("_id", _id);
		append("beginDate", beginDate);
		append("endDate", endDate);
		append("title", title);
		append("text", text);
		append("weiboOpinion_id", weiboOpinion_id);
		append("forumOpinion_id", forumOpinion_id);
		append("commentRatio", commentRatio);
		append("sentimentRatio", sentimentRatio);
		append("reprintRatio", reprintRatio);
		append("watchCount", watchCount);
	}

	public HotspotReport(String beginDate, String endDate, String title, List<String> text, List<String> weiboOpinion_id,
			List<String> forumOpinion_id, Map<Date, Integer> commentRatio, Map<Date, Double> sentimentRatio,
			Map<Date, Integer> reprintRatio, Integer watchCount) {
		append("beginDate", beginDate);
		append("endDate", endDate);
		append("title", title);
		append("text", text);
		append("weiboOpinion_id", weiboOpinion_id);
		append("forumOpinion_id", forumOpinion_id);
		append("commentRatio", commentRatio);
		append("sentimentRatio", sentimentRatio);
		append("reprintRatio", reprintRatio);
		append("watchCount", watchCount);
	}

	public void setUpdate(String method, HotspotReport n) {
		append(method, n);
	}

	@SuppressWarnings("unchecked")
	public Map<String, Integer> getCommentRatio() {
		return (Map<String, Integer>) get("commentRatio");
	}

	public void setCommentRatio(Map<String, Integer> commentRatio) {
		append("commentRatio", commentRatio);
	}

	@SuppressWarnings("unchecked")
	public Map<String, Double> getSentimentRatio() {
		return (Map<String, Double>) get("sentimentRatio");
	}

	public void setSentimentRatio(Map<String, Double> sentimentRatio) {
		append("sentimentRatio", sentimentRatio);
	}

	@SuppressWarnings("unchecked")
	public Map<String, Integer> getReprintRatio() {
		return (Map<String, Integer>) get("reprintRatio");
	}

	public void setReprintRatio(Map<String, Integer> reprintRatio) {
		append("reprintRatio", reprintRatio);
	}

	public ObjectId get_id() {
		return getObjectId("_id");
	}

	public void set_id(ObjectId _id) {
		append("_id", _id);
	}

	public String getBeginDate() {
		return getString("beginDate");
	}

	public void setBeginDate(String beginDate) {
		append("beginDate", beginDate);
	}

	public String getEndDate() {
		return getString("endDate");
	}

	public void setEndDate(String endDate) {
		append("endDate", endDate);
	}

	public String getTitle() {
		return getString("title");
	}

	public void setTitle(String title) {
		append("title", title);
	}

	@SuppressWarnings("unchecked")
	public List<String> getText() {
		return (List<String>) get("text");
	}

	public void setText(List<String> text) {
		append("text", text);
	}

	@SuppressWarnings("unchecked")
	public List<String> getWeiboOpinion_id() {
		return (List<String>) get("weiboOpinion_id");
	}

	public void setWeiboOpinion_id(List<String> weiboOpinion_id) {
		append("weiboOpinion_id", weiboOpinion_id);
	}

	@SuppressWarnings("unchecked")
	public List<String> getForumOpinion_id() {
		return (List<String>) get("forumOpinion_id");
	}

	public void setForumOpinion_id(List<String> forumOpinion_id) {
		append("forumOpinion_id", forumOpinion_id);
	}

	public Integer getStatus() {
		return getInteger("status");
	}

	public void setStatus(Integer status) {
		append("status", status);
	}

	public Integer getWatchCount() {
		return getInteger("watchCount");
	}

	public void setWatchCount(Integer watchCount) {
		append("watchCount", watchCount);
	}
	
	@Override
	public <TDocument> BsonDocument toBsonDocument(Class<TDocument> documentClass, CodecRegistry codecRegistry) {
		// TODO Auto-generated method stub
		return new BsonDocumentWrapper<HotspotReport>(this, codecRegistry.get(HotspotReport.class));
	}
}
